import com.demo.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //1.先得到spring上下文对象
        ApplicationContext context=new ClassPathXmlApplicationContext("spring-config.xml");
        //2.得到Bean(依赖查找，ioc的一种实现)
        UserService userService=(UserService)context.getBean("user");
        //3.使用Bean对象
        userService.sayHi();
    }
}
